package Util;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

public class FactoryDao {

	Conexao cx = new Conexao();
	
	public void AddObject (Object obj)
	{
		cx.OpenConection();
		cx.getSessao().save(obj);
		cx.CloseConection();
	}
	public void UpdateObjet (Object obj)
	{
		cx.OpenConection();
		cx.getSessao().merge(obj);
		cx.CloseConection();
	}
	public void DeleteObjet (Object obj)
	{
		cx.OpenConection();
		cx.getSessao().delete(obj);
		cx.CloseConection();
	}
/*	public Object ListarObjects (String rs)
	{
		Criteria listObjects = cx.getTransacao().createCriteria(rs);
		listObjects.add(Restrictions.ilike(propertyName, value));
		
	} */
}
